import { ArgumentMetadata, Injectable, PipeTransform } from '@nestjs/common';
import { FindGroupParamDto } from '../../dto/group/find-user.dto';

@Injectable()
export class FindGroupPipe implements PipeTransform {
  transform(params: FindGroupParamDto, metadata: ArgumentMetadata) {
    const { pageNum, pageSize } = params;
    const value = {
      pageNum: pageNum ? Number(pageNum) : 1,
      pageSize: pageSize ? Number(pageSize) : 10,
    };
    return value;
  }
}
